import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { LlmConfigVO, LlmConfigForm, LlmConfigQuery } from '@/api/llm/llmConfig/types';

/**
 * 查询系统模型配置列表
 * @param query
 * @returns {*}
 */

export const listLlmConfig = (query?: LlmConfigQuery): AxiosPromise<LlmConfigVO[]> => {
  return request({
    url: '/llm/llmConfig/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询系统模型配置详细
 * @param id
 */
export const getLlmConfig = (id: string | number): AxiosPromise<LlmConfigVO> => {
  return request({
    url: '/llm/llmConfig/' + id,
    method: 'get'
  });
};

/**
 * 新增系统模型配置
 * @param data
 */
export const addLlmConfig = (data: LlmConfigForm) => {
  return request({
    url: '/llm/llmConfig',
    method: 'post',
    data: data
  });
};

/**
 * 修改系统模型配置
 * @param data
 */
export const updateLlmConfig = (data: LlmConfigForm) => {
  return request({
    url: '/llm/llmConfig',
    method: 'put',
    data: data
  });
};

/**
 * 删除系统模型配置
 * @param configId
 */
export const delLlmConfig = (configId: string | number | Array<string | number>) => {
  return request({
    url: '/llm/llmConfig/' + configId,
    method: 'delete'
  });
};
